import http from './request'
import * as api from './api'
export async function login(params = {}, headers = {}) {
  return http.post(api.login, params, headers)
}

export async function logout(params = {}) {
  return http.post(api.logout, params)
}

export async function getRoutes(params = {}) {
  return http.get(api.getRoutes, params)
}

export async function getUserInfo(params = {}) {
  return http.get(api.getUserInfo, params)
}

export async function inspectionDailyReport(params = {}) {
  return http.get(api.inspectionDailyReport, params)
}

export async function getWorkOrderAuditList(params = {}) {
  return http.get(api.getWorkOrderAuditList, params)
}

export async function getWorkOrderList(params = {}) {
  return http.get(api.getWorkOrderList, params)
}


export async function workOderAudit(id) {
  const url = `${api.workOderAudit}/${id}`
  return http.get(url)
}

export async function getInfoByOrderId(params = {}) {
  return http.get(api.getInfoByOrderId, params)
}

export async function getQueryProcess(params = {}) {
  return http.get(api.getQueryProcess, params)
}

export async function getDelayProcessById(params = {}) {
  return http.get(api.getDelayProcessById, params)
}

export async function orderDelayHistory(params = {}) {
  return http.get(api.orderDelayHistory, params)
}

export async function getProjectName(params = {}) {
  return http.get(api.getProjectName, params)
}

export async function getWorkderOrderDispatchList(params = {}) {
  return http.get(api.getWorkderOrderDispatchList, params)
}

export async function getOrganizationTypeList(params = {}) {
  return http.get(api.getOrganizationTypeList, params)
}

export async function getPointInfoList(params = {}) {
  return http.get(api.getPointInfoList, params)
}

export async function getSubcategoryTypeList(params = {}) {
  return http.get(api.getSubcategoryTypeList, params)
}

export async function faultReport(params = {}) {
  return http.post(api.faultReport, params)
}

export async function getContractNamesByProjectName(params = {}) {
  return http.post(api.getContractNamesByProjectName, params)
}

export async function getIoCompany(params = {}) {
  return http.get(api.getIoCompany, params)
}

export async function imageUpload(filePath) {
  return http.uploadLocalImage(api.imageUpload, filePath);
}

export async function dispatchOrder(params = {}) {
  return http.post(api.dispatchOrder, params)
}

export async function workerInitReviewOrderSubmit(params = {}) {
  return http.post(api.workerInitReviewOrderSubmit, params)
}

export async function workerPreReviewOrderSubmit(params = {}) {
  return http.post(api.workerPreReviewOrderSubmit, params)
}

export async function workerLastReviewOrderSubmit(params = {}) {
  return http.post(api.workerLastReviewOrderSubmit, params)
}

export async function getContractList(params = {}) {
  return http.get(api.getContractList, params)
}

export async function getDelayReviewList(params = {}) {
  return http.get(api.getDelayReviewList, params)
}

export async function delayWorkOrderReviewSubmit(params = {}) {
  return http.post(api.delayWorkOrderReviewSubmit, params)
}

export async function getDelayReview(id) {
  const url = `${api.getDelayReview}/${id}`
  return http.get(url)
}

export async function getWorkOrderDealWithList(params = {}) {
  return http.get(api.getWorkOrderDealWithList, params)
}

export async function takeOrder(params = {}) {
  return http.get(api.takeOrder, params)
}

export async function workOrdeDealOrder(params = {}) {
  return http.post(api.workOrdeDealOrder, params)
}

export async function workOrdeDelayOrder(params = {}) {
  return http.post(api.workOrdeDelayOrder, params)
}

export async function backtrackSubmit(params = {}) {
  return http.post(api.backtrackSubmit, params)
}

export async function exportWorkOrderInfo(params = {}, fileName) {
  return http.export(api.exportWorkOrderInfo, params, fileName)
}

export async function ossDownload(ossId) {
  const url = `${api.ossDownload}/${ossId}`
  return http.getImageStream(url)
}